package game.game.ia.state;

import entity.GameEntity;
import game.engine.ia.ICleverEntity;
import game.game.ia.IGameIAModel;
import game.test.ia.IControllerEngine;

import java.util.Iterator;
import java.util.List;

public class StateDead extends GameIAState
{
	public StateDead(IGameIAModel pModel)
	{
		super( pModel );
	}

	@Override
	public void executeState( IControllerEngine pController , ICleverEntity pEntity )
	{
		IGameIAModel model = getModel();
		// si jamais on est mort on se retire du model
		List<GameEntity> list = model.getGameObjects();
		Iterator<GameEntity> it = list.iterator();
		while ( it.hasNext() )
		{
			GameEntity obj = it.next();
			if ( obj == pEntity )
			{
				it.remove();
				break;
			}
		}
	}
}
